#ifndef _USERINFO_H_
#define _USERINFO_H_


#include <string.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>



#include "parameter.h"

class user_node;
class user_list;

class user_info
{
 public:
	user_info() {}
	~user_info() {}
	friend class user_node;
	friend class user_list;

 protected:
	char name[15];
	char password[15];
	int number;

	/* data */
};


class user_node
{
 public:
        user_node () {}
	~user_node () {}
  
	friend class user_list;
	
 protected:
	user_info data;
	//user_node * previous;
	user_node * pNext;

};

class user_list
{
 public:
        user_list () 
	  {
	    this->pHead = NULL;
	  }
	~user_list () {}
 public:
	
	// Creat the head node of the user
	void make_user_head_node ();
	// Creat the head node of the user
	void make_user_node_from_file (user_node *user,FILE *fp,int inst_mthd);
	// Creat the new node and read the file to the node
	int make_user_new_node (user_node **new_node,FILE **fp);
	// Print the information of the user
	void print_info (user_node* ) ;
  	// open the file
	void fopen_user_file(FILE **fp,int mthd_of_fopen);

	
 protected:
	// Add the infos at the head of the list
	void head_insert (user_node** rootp, user_node* new_node);  
	// Add the infos to the list depdending on the number of the user
	void midd_number_insert (user_node** rootp , user_node* new_node);  
	// List is empty
	int list_is_empty (user_node* list);
	// Press any button and get return
	void get_return(char const *mess);
	

	
	
 protected:
	user_node* pHead;
	
};


#endif










